#demo how to read file
#demo how to pass parameters of array and other scalar variables

my $fileName = "aaa";
open( FP, "<", $fileName ) or die $!;

my @newAsso            = ();
my $newAssoStartLineNo = 0;

my $lineNo = 0;
while ( my $line = <FP> )
{
	$lineNo++;
	$line =~ s/^\s+//;
	$line =~ s/\s+$//;
	next if length $line <= 0;

	$newAssoStartLineNo = $lineNo;
	@newAsso            = ();
	do
	{
		push @newAsso, $line;
		$line = <FP>;
		$lineNo++;
		$line =~ s/^\s+//;
		$line =~ s/\s+$//;
	} while ( length $line > 0 );

	&ProcessNewAsso( $newAssoStartLineNo, @newAsso );
}

sub ProcessNewAsso
{
	my ( $newAssoStartLineNo, @newAsso ) = @_;

	print "\n\n$newAssoStartLineNo\n";

	foreach (@newAsso)
	{
		print "$_\n";
	}
}

